<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title>乐优商城--订单评价</title>
    <link rel="icon" href="/assets/img/favicon.ico">
    <link rel="stylesheet" type="text/css" href="css/webbase.css" />
    <link rel="stylesheet" type="text/css" href="css/pages-payfail.css" />
    <title>Title</title>
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
<script src="js/vue/vue.min.js"></script>
<script src="js/index.js"></script>
<script src="js/axios.min.js"></script>
<script src="plugins/jquery/jquery.min.js"></script>
<script src="./js/common.js"></script>
<script type="text/javascript" src="js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="components/ui-modules/nav/nav-portal-top.js"></script>
<!--页面顶部白条条，由js动态加载-->
<script type="text/javascript" src="plugins/jquery/jquery.min.js"></script>
<div class="top"></div>
<script type="text/javascript">$(".top").load("shortcut.html");</script>

<div class="cart py-container">
    <!--logoArea-->
    <div class="logoArea">
        <div class="fl logo"><span class="title">订单评价</span></div>
    </div>
<!--主内容-->
<div id="app" >
    <el-form ref="form" :model="form" label-width="80px">
        <h3>描述相符:</h3>
        <el-rate v-model="form.value1" show-text></el-rate>
        <h4>评价:</h4>
            <el-input  type="textarea" placeholder="从多个角度评价宝贝，可以帮助更多想买的人" v-model="form.descData" ></el-input>
        <el-upload
                class="upload-demo"
                action=""
                :on-preview="handlePreview"
                :on-remove="handleRemove"
                :file-list="fileList"
                list-type="picture">
            <h4>商品买家秀:</h4>
            <el-button size="small" type="primary">点击上传</el-button>
            <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
        </el-upload>
        <h3>商家服务态度：</h3>
        <el-rate v-model="form.value2" show-text></el-rate>
        <h3>物流服务：</h3>
        <el-rate v-model="form.value3" show-text></el-rate>
        <el-form-item>
            <el-button type="primary" @click="onSubmit">提交评论</el-button>
            <el-button>取消</el-button>
        </el-form-item>
    </el-form>
</div>
</div>
<script>
    //获取地址栏参数，name:参数名称
    function getUrlParms(name){
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)
            return unescape(r[2]);
        return null;
    }
    var id = getUrlParms("id")
    var vue = new Vue({
        el:"#app",
        data: {
            form: {
                orderId:id,
                descData: '',
                value1: null,
                value2: null,
                value3: null,
                },
            fileList: [{url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}]
        },
        methods: {
            onSubmit() {
           ly.http.post("trade/order/comment",this.form).then((res)=>{
                if(res.data){
                location.href = "/commentok.html?id="+id;
                }else {
                    alert("评价失败")
                }
            })
            },
            handleRemove(file, fileList) {
            },
            handlePreview(file) {
            }
        }
    });
</script>
</body>

<!-- 底部栏位 -->
<!--页面底部，由js动态加载-->
<div class="clearfix footer"></div>
<script type="text/javascript">$(".footer").load("foot.html");</script>
<!--页面底部END-->

</html>